Skip to content

Record the pull request number in the results as clickbench_pr#994

Merged
alexey-milovidov merged 1 commit into
mainfrom
clickbench-pr-provenance
Jul 20, 2026
Merged

Record the pull request number in the results as clickbench_pr#994
alexey-milovidov merged 1 commit into
mainfrom
clickbench-pr-provenance

Conversation

@alexey-milovidov

Copy link
Copy Markdown
Member

Follow-up to #993: benchmark runs launched for a pull request are now marked, so the future collection step can tell them apart from the runs of main — without this, a PR run of an existing system would land in sink.results indistinguishable from the daily run and could be published as the official result.

  • cloud-init.sh.in writes a ClickBench PR: <number> line into the log header (empty for runs of main).
  • sink.parser extracts it into a new clickbench_pr UInt32 column of sink.results (prepare-database.sql). The pattern is (\d*), not (\d+): the header line comes first in the log, and its empty match for runs of main stops the search before any spoofed ClickBench PR: N in untrusted benchmark output.
  • collect-results.sh filters clickbench_pr = 0, so PR runs are never published.
  • repo and branch are now empty by default: when clickbench_pr is set, run-benchmark.sh derives the PR's head repository and branch from the GitHub API; otherwise they fall back to ClickHouse/ClickBench and main. The PR workflow therefore passes only the PR number, and the manual workflow takes an optional pr input — any PR can be benchmarked by number.

Requires two statements on the sink database before merging (add the column, update the parser view); until the view is updated, PR runs would be recorded with clickbench_pr = 0.

🤖 Generated with Claude Code

The log gets a 'ClickBench PR:' line (empty for runs of main), parsed
into the new clickbench_pr column of sink.results, and PR runs are
excluded from collect-results.sh so they cannot be published as
official results.

repo and branch are now empty by default: when clickbench_pr is set,
run-benchmark.sh derives them from the PR's head via the GitHub API;
otherwise they fall back to ClickHouse/ClickBench and main. The manual
workflow gets a pr input, so any PR can be benchmarked by number.

The '(\d*)' in the parser matters: the header line comes first in the
log with no digits for runs of main, and the empty match there stops
the search before any spoofed 'ClickBench PR: N' in untrusted output.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@alexey-milovidov alexey-milovidov self-assigned this Jul 20, 2026

@alexey-milovidov alexey-milovidov left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok.

@alexey-milovidov
alexey-milovidov merged commit 3686578 into main Jul 20, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant